﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Management_Web_DllcEditor_editor_filemanager_browser_default_FCKdel_file : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string UD = Request.QueryString["UD"];// Shove._Web.Utility.GetRequest("UD");        //生成的随机数
            string FilePath = Request.QueryString["filePath"];// Shove._Web.Utility.GetRequest("filePath");

            DeleteFile(FilePath);
        }
    }

    private void DeleteFile(string FileName)
    {
        string Result = "-2";

        if (string.IsNullOrEmpty(FileName))
        {
            Result = "0";                   // 文件删除失败!请检查文件是否存在!                
        }

        try
        {
            //string Root = System.AppDomain.CurrentDomain.BaseDirectory;     //当前应用程序目录
            //FileName = FileName.Replace("/SFS_BQW/", "");
            //System.IO.File.Delete(Root + FileName);
            System.IO.File.Delete(Server.MapPath(FileName));
        }
        catch
        {
            Result = "-2";                // 未知错误!                
        }

        Result = "1";
        Response.Write(Result);
    }



}
